import http from '~/utils/http';

export const setCoupon = data => {
    return http({
        url: 'web/coupon/save',
        method: 'post',
        data
    });
};
export const updateCoupon = data => {
    return http({
        url: 'web/coupon/update',
        method: 'post',
        data
    });
};
export const getCouponList = data => {
    return http({
        url: 'web/coupon/list',
        method: 'post',
        data
    });
};
//批量发卷
export const sendCoupon = data => {
    return http({
        url: 'web/couponInfo/push',
        method: 'post',
        data
    });
};
//批量发卷列表
export const getSendCouponList = data => {
    return http({
        url: 'web/couponInfo/list',
        method: 'post',
        data
    });
};
//领取优惠卷
export const receiveCoupon = data => {
    return http({
        url: 'web/couponInfo/receive',
        method: 'post',
        data
    });
};
//获取用户的优惠卷
export const getUserCoupon = id => {
    return http({
        url: 'web/couponInfo/queryUserId?userId='+id,
        method: 'get',
    });
};
//获取课程对应的优惠卷
export const getCourseCoupon = id => {
    return http({
        url: 'web/coupon/getByCourseId?courseId='+id,
        method: 'get',
    });
};